<!--网站导航.搜索条1-->
<script src="/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/uploadify/uploadify.css">
<div class="header-Nav" style="width: 780px;">
    <div class="Nav-left menulist">
        <ul>
            <li><a href="<?php echo WEB_DOMAIN; ?>/app">应用管理</a></li>
             <li><a href="#">应用编辑 { <?php echo $data["name"];?> }</a></li>
             <li><a href="#" style="color: red"><?php echo $err_msg;?></a></li>
             <li><a>提示：若您更改了应用内容，则需要重新审核</a></li>
        </ul>
    </div>
</div>
<form class="bs-docs-example form-horizontal" action="<?php echo WEB_DOMAIN; ?>/app/edit/id/<?php echo $data["id"] ?>" id="register_submit" method="post" enctype="application/x-www-form-urlencoded">
    <input type="hidden" name="edit[id]" value="<?php echo $UserInfo["id"] ?>">
    <input type="hidden" name="edit[appid]" value="<?php echo $data["id"] ?>">
        <div class="control-group info">
        <label for="inputError" class="control-label">应用名称：</label>
        <div class="controls">
            <input type="text" class="input-xxlarge" name="edit[name]" id="addname" value="<?php echo $data["name"] ?>">
        </div>
    </div>
        <div class="control-group info">
        <label for="input" class="control-label">应用版本号：</label>
        <div class="controls">
             <input type="text" class="input-xlarge" name="edit[version]" id="version" value="<?php echo $data["version"] ?>">
        </div>
    </div>
    <div class="control-group info">
        <label for="inputError" class="control-label">应用平台：</label>
        <div class="controls">
            <li class="form-inline">
              <label><input type="radio"  name="edit[platformid]" id="version" value="1" checked>iphone</label>
              <label><input type="radio"  name="edit[platformid]" id="version" value="2">ipad</label>
              <label><input type="radio"  name="edit[platformid]" id="version" value="3">Android</label>
              <label><input type="radio"  name="edit[platformid]" id="version" value="4">iphone&ipad</label>
              </li>
        </div>
    </div>
    <div class="control-group success">
        <label for="inputSuccess" class="control-label">应用分类：</label>
        <div class="controls">
            <select name="edit[classid]" class="span2">
            <?php 
             if(isset($appClass)){
                 foreach ($appClass as $key=>$val){
                     if($data["classid"]==$val["id"]){
                        echo '<option value="'.$val["id"].'" selected="selected">'.$val["title"].'</option>'; 
                     }else{
                        echo '<option value="'.$val["id"].'">'.$val["title"].'</option>';
                     }
                 }
             }
            ?>
        </select>
            <span class="help-inline"></span>
        </div>
    </div>
    <div class="control-group success">
        <label for="inputSuccess" class="control-label">应用连接：</label>
        <div class="controls">
            <input type="text" id="appurl" class="input-xxlarge" name="edit[appurl]" value="<?php echo $data["appurl"] ?>">
            <span class="help-inline">请填写您的APP在应用市场上的下载地址</span>
        </div>
    </div>
    <div class="control-group success">
        <label for="inputSuccess" class="control-label">应用图标：</label>
        <div class="controls">
            <input type="hidden" id="uploadFileName" name="edit[appimg]" value="<?php echo $data["appimg"] ?>">
            <input type="file" id="file_upload"  multiple="true">
            <span class="help-inline" id="uperr"><img src="<?php echo $data["appimg"] ?>" style="height: 72px;" />
            请上传尺寸不小于 72x72 , 大小不超过1M, 格式为 png, jpg, jpeg 的图标</span>
        </div>
    </div>
    <div class="control-group success">
        <label for="inputSuccess" class="control-label">应用介绍：</label>
        <div class="controls">
            <textarea name="edit[introduce]"><?php echo $data["introduce"] ?></textarea>
            <span class="help-inline"></span>
        </div>
    </div>
    <button class="btn btn-large btn-block" type="submit">保存并进入下一步</button>
</form>
<script type="text/javascript">
<?php $timestamp = time(); ?>
    $(function() {
        $('#file_upload').uploadify({
            'formData'     : {
                'timestamp' : '<?php echo $timestamp; ?>',
                'token'     : '<?php echo md5('bingo_file' . $timestamp); ?>'
            },
            'swf'      : '/uploadify/uploadify.swf',
            'uploader' : '/uploadfile',
            'onUploadSuccess': function (file, data, response){
                var strs=data.split(",");
                var ttb=data.substring(0,3);
                $("#uperr").empty();
                if(ttb.indexOf('0,')==-1){
                    $("#uploadFileName").val(strs[1]);
                    $("#uperr").html("<img src='"+ strs[1] +"' style='height: 72px;' />");               
                }else{ 
                    $("#uperr").html("上传失败");
                }
            }
        });
    });
</script>